import { getValueById, dataBase } from '@/utils/database'
export const columns = [
  {
    name: 'repairOrderNo',
    label: '订单编号',
    width: 200,
    search: true,
    value: '',
    valueType: 'input',
    span: 8,
    attrs: {
      placeholder: '请输入订单编号',
    },
  },

  {
    name: 'repairStatus',
    label: '维修单状态',
    search: true,
    value: '',
    width: 120,
    valueType: 'select',
    options: dataBase.weixiudanzhuangtai,
    span: 8,
    formatter: (v) => {
      if (v.repairStatus) {
        return getValueById('weixiudanzhuangtai', v.repairStatus)
      }
    },
    attrs: {
      placeholder: '选择维修单状态',
    },
  },
  {
    name: 'deviceNumber',
    search: true,
    label: '设备编号',
    width: 100,
    valueType: 'input',
    span: 8,
    attrs: {
      placeholder: '请输入设备编号',
      maxlength: 70,
      clearable: true,
    },
  },
  {
    name: 'deviceType',
    label: '设备类型',
    width: 150,
  },
  {
    name: 'userName',
    label: '用户名',
    width: 150,
  },
  {
    name: 'userMobile',
    label: '手机号',
    width: 150,
  },

  {
    name: 'noVulnerability',
    label: '机损金额',
    width: 150,
  },
  {
    name: 'vulnerability',
    label: '易损金额',
    width: 150,
  },

  {
    name: 'repairTravelFee',
    label: '差旅费',
    width: 150,
  },
  {
    name: 'repairManhourFee',
    label: '人工费',
  },
  {
    name: 'actualPayment',
    label: '实付金额',
    width: 150,
  },

  {
    name: 'createTime',
    label: '创建时间',
    width: 180,
  },
  {
    name: 'repairOrderType',
    label: '维修单类型',
    width: 180,
    formatter: (v) => {
      if (v.repairOrderType) {
        return getValueById('weixiudanleixing', v.repairOrderType)
      }
    },
  },
  {
    name: 'operate',
    label: '操作',
    slot: true,
  },
]
